/**
 * Creat with IntelliJ IDEA
 * Description:
 * User:WZW
 * Date:2022-04-18
 * Time:20:19
 */


class MyRunnable implements Runnable{//通过Runnable来描述任务的内容
    @Override
    public void run() {
        System.out.println("hello");
    }
}

public class Demo3 {
    public static void main(String[] args) {
        //把描述到的任务通过Runnable实例交给Thread的实例
        Thread t = new Thread(new MyRunnable());
        t.start();
    }
}
